package com.fit.toysShop.components;

import org.apache.tapestry5.annotations.ApplicationState;

import com.fit.toysShop.interfaces.User;


public class NavMenu {
	@ApplicationState
	private User user;
	private boolean userExists;
	public  User getUser()
	{
		return this.user;
	}

	public String getLoggedUser() {
		if (userExists) {
			return getUser().getUserName(); 
		}
		return "";
	}

	public boolean isAdmin() {
		if (getLoggedUser().equalsIgnoreCase("admin")) return true;
		else return false;
	}
	
	public boolean isNotAdmin() {
		if (!getLoggedUser().equalsIgnoreCase("admin")) return true;
		else return false;
	}	
}
